package own.stu.jobgib.playown.event.subcribe;

import com.google.common.eventbus.Subscribe;
import lombok.extern.slf4j.Slf4j;
import own.stu.jobgib.playown.event.event.CarAddInfoEvent;
import own.stu.jobgib.playown.event.event.PositionInfoEvent;

import java.util.concurrent.TimeUnit;

@Slf4j
public class PositionSubscriber {

    @Subscribe
    public void onMessage(PositionInfoEvent event) throws Exception {
        log.info("position info : {}", event);
        TimeUnit.MILLISECONDS.sleep(100);
    }

    @Subscribe
    public void onMessage(CarAddInfoEvent event) throws Exception {
        log.info("car position info : {}", event);
        TimeUnit.MILLISECONDS.sleep(100);
    }
}
